using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Communication_KcpListener_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Communication.KcpListener);
            args = new Type[]{};
            method = type.GetMethod("get_AllLinkCount", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_AllLinkCount_0);
            args = new Type[]{};
            method = type.GetMethod("get_Port", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Port_1);
            args = new Type[]{typeof(System.Int32)};
            method = type.GetMethod("Start", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Start_2);
            args = new Type[]{};
            method = type.GetMethod("SendAll", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SendAll_3);
            args = new Type[]{};
            method = type.GetMethod("Dispose", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispose_4);
            args = new Type[]{typeof(System.Byte[]), typeof(System.Int32), typeof(System.Net.IPEndPoint)};
            method = type.GetMethod("Dispatch", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Dispatch_5);
            args = new Type[]{typeof(System.Byte[]), typeof(System.Net.IPEndPoint)};
            method = type.GetMethod("Send", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Send_6);
            args = new Type[]{typeof(huqiang.Communication.NetworkLink)};
            method = type.GetMethod("RemoveLink", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, RemoveLink_7);
            args = new Type[]{typeof(System.Byte[]), typeof(System.Int32)};
            method = type.GetMethod("PostBroadcast", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, PostBroadcast_8);
            args = new Type[]{typeof(System.Int32)};
            method = type.GetMethod("FindBroadcastMsg", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, FindBroadcastMsg_9);
            args = new Type[]{typeof(System.Int32)};
            method = type.GetMethod("UpdateBroadcastMsg", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, UpdateBroadcastMsg_10);
            args = new Type[]{typeof(huqiang.Communication.NetworkLink)};
            method = type.GetMethod("PreRecycling", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, PreRecycling_11);

            field = type.GetField("Heart", flag);
            app.RegisterCLRFieldGetter(field, get_Heart_0);
            app.RegisterCLRFieldSetter(field, set_Heart_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_Heart_0, AssignFromStack_Heart_0);
            field = type.GetField("TimeOut", flag);
            app.RegisterCLRFieldGetter(field, get_TimeOut_1);
            app.RegisterCLRFieldSetter(field, set_TimeOut_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_TimeOut_1, AssignFromStack_TimeOut_1);
            field = type.GetField("NowMillisecond", flag);
            app.RegisterCLRFieldGetter(field, get_NowMillisecond_2);
            app.RegisterCLRFieldSetter(field, set_NowMillisecond_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_NowMillisecond_2, AssignFromStack_NowMillisecond_2);
            field = type.GetField("soc", flag);
            app.RegisterCLRFieldGetter(field, get_soc_3);
            app.RegisterCLRFieldSetter(field, set_soc_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_soc_3, AssignFromStack_soc_3);
            field = type.GetField("recvThread", flag);
            app.RegisterCLRFieldGetter(field, get_recvThread_4);
            app.RegisterCLRFieldSetter(field, set_recvThread_4);
            app.RegisterCLRFieldBinding(field, CopyToStack_recvThread_4, AssignFromStack_recvThread_4);
            field = type.GetField("sendThread", flag);
            app.RegisterCLRFieldGetter(field, get_sendThread_5);
            app.RegisterCLRFieldSetter(field, set_sendThread_5);
            app.RegisterCLRFieldBinding(field, CopyToStack_sendThread_5, AssignFromStack_sendThread_5);
            field = type.GetField("Speed", flag);
            app.RegisterCLRFieldGetter(field, get_Speed_6);
            app.RegisterCLRFieldSetter(field, set_Speed_6);
            app.RegisterCLRFieldBinding(field, CopyToStack_Speed_6, AssignFromStack_Speed_6);
            field = type.GetField("OnBeforeDownload", flag);
            app.RegisterCLRFieldGetter(field, get_OnBeforeDownload_7);
            app.RegisterCLRFieldSetter(field, set_OnBeforeDownload_7);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnBeforeDownload_7, AssignFromStack_OnBeforeDownload_7);
            field = type.GetField("OnBeforeUpload", flag);
            app.RegisterCLRFieldGetter(field, get_OnBeforeUpload_8);
            app.RegisterCLRFieldSetter(field, set_OnBeforeUpload_8);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnBeforeUpload_8, AssignFromStack_OnBeforeUpload_8);
            field = type.GetField("OnDownloadCompelete", flag);
            app.RegisterCLRFieldGetter(field, get_OnDownloadCompelete_9);
            app.RegisterCLRFieldSetter(field, set_OnDownloadCompelete_9);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnDownloadCompelete_9, AssignFromStack_OnDownloadCompelete_9);
            field = type.GetField("OnUploadCompelete", flag);
            app.RegisterCLRFieldGetter(field, get_OnUploadCompelete_10);
            app.RegisterCLRFieldSetter(field, set_OnUploadCompelete_10);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnUploadCompelete_10, AssignFromStack_OnUploadCompelete_10);
            field = type.GetField("OnDownloadError", flag);
            app.RegisterCLRFieldGetter(field, get_OnDownloadError_11);
            app.RegisterCLRFieldSetter(field, set_OnDownloadError_11);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnDownloadError_11, AssignFromStack_OnDownloadError_11);
            field = type.GetField("OnUploadError", flag);
            app.RegisterCLRFieldGetter(field, get_OnUploadError_12);
            app.RegisterCLRFieldSetter(field, set_OnUploadError_12);
            app.RegisterCLRFieldBinding(field, CopyToStack_OnUploadError_12, AssignFromStack_OnUploadError_12);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Communication.KcpListener());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Communication.KcpListener[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_AllLinkCount_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.AllLinkCount;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* get_Port_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Port;

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* Start_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @port = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Start(@port);

            return __ret;
        }

        static StackObject* SendAll_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SendAll();

            return __ret;
        }

        static StackObject* Dispose_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispose();

            return __ret;
        }

        static StackObject* Dispatch_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 4);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Net.IPEndPoint @endPoint = (System.Net.IPEndPoint)typeof(System.Net.IPEndPoint).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 @len = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Byte[] @dat = (System.Byte[])typeof(System.Byte[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Dispatch(@dat, @len, @endPoint);

            return __ret;
        }

        static StackObject* Send_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Net.IPEndPoint @ip = (System.Net.IPEndPoint)typeof(System.Net.IPEndPoint).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Byte[] @data = (System.Byte[])typeof(System.Byte[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Send(@data, @ip);

            return __ret;
        }

        static StackObject* RemoveLink_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.NetworkLink @link = (huqiang.Communication.NetworkLink)typeof(huqiang.Communication.NetworkLink).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.RemoveLink(@link);

            return __ret;
        }

        static StackObject* PostBroadcast_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 3);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @spin = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Byte[] @dat = (System.Byte[])typeof(System.Byte[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.PostBroadcast(@dat, @spin);

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static StackObject* FindBroadcastMsg_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @msgID = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.FindBroadcastMsg(@msgID);

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* UpdateBroadcastMsg_10(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @msgID = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.UpdateBroadcastMsg(@msgID);

            return __ret;
        }

        static StackObject* PreRecycling_11(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.Communication.NetworkLink @link = (huqiang.Communication.NetworkLink)typeof(huqiang.Communication.NetworkLink).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.Communication.KcpListener instance_of_this_method = (huqiang.Communication.KcpListener)typeof(huqiang.Communication.KcpListener).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.PreRecycling(@link);

            return __ret;
        }


        static object get_Heart_0(ref object o)
        {
            return huqiang.Communication.KcpListener.Heart;
        }

        static StackObject* CopyToStack_Heart_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.KcpListener.Heart;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_Heart_0(ref object o, object v)
        {
            huqiang.Communication.KcpListener.Heart = (System.Byte[])v;
        }

        static StackObject* AssignFromStack_Heart_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Byte[] @Heart = (System.Byte[])typeof(System.Byte[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            huqiang.Communication.KcpListener.Heart = @Heart;
            return ptr_of_this_method;
        }

        static object get_TimeOut_1(ref object o)
        {
            return huqiang.Communication.KcpListener.TimeOut;
        }

        static StackObject* CopyToStack_TimeOut_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.KcpListener.TimeOut;
            __ret->ObjectType = ObjectTypes.Long;
            *(long*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_TimeOut_1(ref object o, object v)
        {
            huqiang.Communication.KcpListener.TimeOut = (System.Int64)v;
        }

        static StackObject* AssignFromStack_TimeOut_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int64 @TimeOut = *(long*)&ptr_of_this_method->Value;
            huqiang.Communication.KcpListener.TimeOut = @TimeOut;
            return ptr_of_this_method;
        }

        static object get_NowMillisecond_2(ref object o)
        {
            return huqiang.Communication.KcpListener.NowMillisecond;
        }

        static StackObject* CopyToStack_NowMillisecond_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = huqiang.Communication.KcpListener.NowMillisecond;
            __ret->ObjectType = ObjectTypes.Long;
            *(long*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_NowMillisecond_2(ref object o, object v)
        {
            huqiang.Communication.KcpListener.NowMillisecond = (System.Int64)v;
        }

        static StackObject* AssignFromStack_NowMillisecond_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int64 @NowMillisecond = *(long*)&ptr_of_this_method->Value;
            huqiang.Communication.KcpListener.NowMillisecond = @NowMillisecond;
            return ptr_of_this_method;
        }

        static object get_soc_3(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).soc;
        }

        static StackObject* CopyToStack_soc_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).soc;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_soc_3(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).soc = (System.Net.Sockets.Socket)v;
        }

        static StackObject* AssignFromStack_soc_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Net.Sockets.Socket @soc = (System.Net.Sockets.Socket)typeof(System.Net.Sockets.Socket).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.KcpListener)o).soc = @soc;
            return ptr_of_this_method;
        }

        static object get_recvThread_4(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).recvThread;
        }

        static StackObject* CopyToStack_recvThread_4(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).recvThread;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_recvThread_4(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).recvThread = (System.Threading.Thread)v;
        }

        static StackObject* AssignFromStack_recvThread_4(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Threading.Thread @recvThread = (System.Threading.Thread)typeof(System.Threading.Thread).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.KcpListener)o).recvThread = @recvThread;
            return ptr_of_this_method;
        }

        static object get_sendThread_5(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).sendThread;
        }

        static StackObject* CopyToStack_sendThread_5(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).sendThread;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_sendThread_5(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).sendThread = (System.Threading.Thread)v;
        }

        static StackObject* AssignFromStack_sendThread_5(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Threading.Thread @sendThread = (System.Threading.Thread)typeof(System.Threading.Thread).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.KcpListener)o).sendThread = @sendThread;
            return ptr_of_this_method;
        }

        static object get_Speed_6(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).Speed;
        }

        static StackObject* CopyToStack_Speed_6(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).Speed;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_Speed_6(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).Speed = (System.Int32)v;
        }

        static StackObject* AssignFromStack_Speed_6(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int32 @Speed = ptr_of_this_method->Value;
            ((huqiang.Communication.KcpListener)o).Speed = @Speed;
            return ptr_of_this_method;
        }

        static object get_OnBeforeDownload_7(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnBeforeDownload;
        }

        static StackObject* CopyToStack_OnBeforeDownload_7(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnBeforeDownload;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnBeforeDownload_7(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnBeforeDownload = (System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>)v;
        }

        static StackObject* AssignFromStack_OnBeforeDownload_7(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String> @OnBeforeDownload = (System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>)typeof(System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnBeforeDownload = @OnBeforeDownload;
            return ptr_of_this_method;
        }

        static object get_OnBeforeUpload_8(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnBeforeUpload;
        }

        static StackObject* CopyToStack_OnBeforeUpload_8(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnBeforeUpload;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnBeforeUpload_8(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnBeforeUpload = (System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>)v;
        }

        static StackObject* AssignFromStack_OnBeforeUpload_8(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String> @OnBeforeUpload = (System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>)typeof(System.Func<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileInfo, System.String>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnBeforeUpload = @OnBeforeUpload;
            return ptr_of_this_method;
        }

        static object get_OnDownloadCompelete_9(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnDownloadCompelete;
        }

        static StackObject* CopyToStack_OnDownloadCompelete_9(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnDownloadCompelete;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnDownloadCompelete_9(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnDownloadCompelete = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)v;
        }

        static StackObject* AssignFromStack_OnDownloadCompelete_9(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission> @OnDownloadCompelete = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)typeof(System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnDownloadCompelete = @OnDownloadCompelete;
            return ptr_of_this_method;
        }

        static object get_OnUploadCompelete_10(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnUploadCompelete;
        }

        static StackObject* CopyToStack_OnUploadCompelete_10(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnUploadCompelete;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnUploadCompelete_10(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnUploadCompelete = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)v;
        }

        static StackObject* AssignFromStack_OnUploadCompelete_10(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission> @OnUploadCompelete = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)typeof(System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnUploadCompelete = @OnUploadCompelete;
            return ptr_of_this_method;
        }

        static object get_OnDownloadError_11(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnDownloadError;
        }

        static StackObject* CopyToStack_OnDownloadError_11(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnDownloadError;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnDownloadError_11(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnDownloadError = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)v;
        }

        static StackObject* AssignFromStack_OnDownloadError_11(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission> @OnDownloadError = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)typeof(System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnDownloadError = @OnDownloadError;
            return ptr_of_this_method;
        }

        static object get_OnUploadError_12(ref object o)
        {
            return ((huqiang.Communication.KcpListener)o).OnUploadError;
        }

        static StackObject* CopyToStack_OnUploadError_12(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpListener)o).OnUploadError;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_OnUploadError_12(ref object o, object v)
        {
            ((huqiang.Communication.KcpListener)o).OnUploadError = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)v;
        }

        static StackObject* AssignFromStack_OnUploadError_12(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission> @OnUploadError = (System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>)typeof(System.Action<huqiang.Communication.NetworkLink, huqiang.Communication.KcpFileMission>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)8);
            ((huqiang.Communication.KcpListener)o).OnUploadError = @OnUploadError;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Communication.KcpListener();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
